<?php use_javascript('contact.js')?>
<?php use_javascript('accountCustomer.js')?>
<?php use_javascript('accountSupplier.js')?>
<?php use_javascript('accountOwner.js')?>
<div class="module_title">Customer Reports</div>
<div id="reportsCustomerMenuBar" class="menu_bar">
  <?php echo link_to('Statement of Account', 'contact/search',array('id'=>'reportsCustomerMenuItemSOA','class'=>'menu_unselected',))?>
  <?php echo link_to('Receivables', 'reportsCustomer/receivables',array('id'=>'reportsCustomerMenuItemReceivables','class'=>'menu_unselected',))?>
  <?php echo link_to('Detailed Receivables', 'contact/search',array('id'=>'reportsCustomerMenuItemDetailedReceivables','class'=>'menu_unselected',))?>
  <?php echo link_to('Invoice Summary', 'contact/search',array('id'=>'reportsCustomerMenuItemInvoiceSummary','class'=>'menu_unselected',))?>
  <?php echo link_to('Checks Summary', 'reportsCustomer/checksSummary',array('id'=>'reportsCustomerMenuItemChecksSummary','class'=>'menu_unselected',))?>
</div>
<div id="ajMain">
</div>
<div id="<?php echo sfConfig::get('app_windows_contact_panel_id')?>" style="display:none">
</div>
<div id="reportsCustomerSearchPanel" style="display:none"></div>

<script language="javascript">
  $(document).ready(
    function(){
      $("#reportsCustomerMenuItemSOA").click(
        function(e){
          menuSelect("#reportsCustomerMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").show().html(content);
              $("#ajContactPanel").hide();
              $("#reportsCustomerSearchPanel").hide();
              $("#ajContactForm").remove();
              contactDialogMode=30;
            }
          );
          e.preventDefault();
        }
      );
      $("#reportsCustomerMenuItemDetailedReceivables").click(
        function(e){
          menuSelect("#reportsCustomerMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").show().html(content);
              $("#ajContactPanel").hide();
              $("#reportsCustomerSearchPanel").hide();
              $("#ajContactForm").remove();
              contactDialogMode=31;
            }
          );
          e.preventDefault();
        }
      );
      $("#reportsCustomerMenuItemInvoiceSummary").click(
        function(e){
          menuSelect("#reportsCustomerMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").show().html(content);
              $("#ajContactPanel").hide();
              $("#reportsCustomerSearchPanel").hide();
              $("#ajContactForm").remove();
              contactDialogMode=32;
            }
          );
          e.preventDefault();
        }
      );  
      $("#reportsCustomerMenuItemReceivables").click(
        function(e){
          menuSelect("#reportsCustomerMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").show().html(content);
              $("#ajContactPanel").hide();
              $("#reportsCustomerSearchPanel").hide();
              $("#ajContactForm").remove();
            }
          );
          e.preventDefault();
        }
      ); 
      $("#reportsCustomerMenuItemChecksSummary").click(
        function(e){
          menuSelect("#reportsCustomerMenuBar",this);
          $.get(this.href,{},
            function(content){
              $("#ajMain").show().html(content);
              $("#ajContactPanel").hide();
              $("#reportsCustomerSearchPanel").hide();
              $("#ajContactForm").remove();
            }
          );
          e.preventDefault();
        }
      );
    }
  );
</script>
